#ifndef HRVDATA_H
#define HRVDATA_H
#include "qlist.h"
#include <QMetaType>
struct HRV_Time{
    QList<int>RR;
    int RR_mean;	    // RR间期均值
    double  RR_CV; 	    //变异指数
    double RR_SDNN;	    //RR间期标准差
    int RR_DRR; 	    //RR间期极差
    double RR_RMSSD; 	//RR间期均方根值
    double SDSD;		//RR间期差的标准差
    int NN50;		    //连续RR间期差大于50ms的RR间期个数
    double pNN50; 	    //连续RR间期差大于50ms的RR间期个数占总数的百分比
    double ApEn;        //近似商
    double Psi;         //压力指数
};
Q_DECLARE_METATYPE(HRV_Time)

struct HRV_Freq{
    double TP;		//总功率（总能量）
    double VLF;	//极低频能量
    double LF;	//低频能量
    double HF;	//高低频能量
    double LFHF;	//低高频能量比
    double LFnorm;	//归一化低频能量
    double HFnorm;	//归一化高频能量
    QList<double>freq;
    QList<double>psd;
};
Q_DECLARE_METATYPE(HRV_Freq)
struct HRV_NonLinear{
    double VAI;	//向量角度指数
    double VLI;	//向量长度指数
    double SD1;	//短轴
    double SD2;	//长轴
};
Q_DECLARE_METATYPE(HRV_NonLinear)

struct HRV_SL{//生理指标
    unsigned char MeanHrt;
    unsigned char MaxHrt;
    unsigned char MinHrt;
    unsigned char AbnormalHeartNum;//异常心率个数
    unsigned char ox;
    double Perfusion;
};
Q_DECLARE_METATYPE(HRV_SL)

struct APPG{
    unsigned char Age;
    double K;
    QList<double>Pre_PPG;
    QList<double>Pre_APPG;
    int ActualLen;//实际脉搏波和加速度脉搏波长度
    QList<int>abcde;
    int VascularState;//血管阶段
    QList<double>SevenState;
    double DPI;//微分脉搏波指数
    double SP;//每搏输出量
    double BVT;//血管弹性
    double RBV;//残血量
    QString Vascular_res;
};
Q_DECLARE_METATYPE(APPG)

struct MentalPressure{
    int TP_State ;         //活性状态
    int MSI_State ;        //精神压力状态
    int PSI_State ;        //身体压力状态
    int SDNN_Sate ;        //抗压能力状态
    int LF_State ;         //身体疲劳指数状态
    int HF_State ;         //心脏稳定性状态
    int HRT_State ;        //心率状态
    double tpScore;        //TP能量，用于绘图
    double MsiScore;       //精神压力
    double SdnnScore;      //抗压能力
    double PsiScore;       //身体压力
    double lfScore;        //疲劳
    double hfScore;        //心脏稳定性
    double AnsScore ;      //平衡性
    int Ans_State;         //自主神经功能状态
    double TotalScore ;    //活性
    double EmotionScore;   //情绪状态
};
Q_DECLARE_METATYPE(MentalPressure)

struct HRVIndex{
    HRV_Time time;
    HRV_Freq freq;
    HRV_NonLinear non;
    HRV_SL sl;
    MentalPressure mp;
    QString SLResults;
    QString MentalPressureResults;
    QString AnsResults;
    QString HRVResults;
    APPG appg;
};
Q_DECLARE_METATYPE(HRVIndex)

#endif // HRVDATA_H
